//
//  ViewController.m
//  LessTwo
//
//  Created by liuchengming on 16/4/19.
//  Copyright © 2016年 liuchengming. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{
    NSArray * data ;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    
    data = @[@"我靠！！",
             @"你是🐷吗？",
             @"编个小程序都不会",
             @"脑子炸了是不是？"];
    
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.view.backgroundColor =[UIColor redColor];
    
    
    UITableView *tableview =[[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    
    tableview.dataSource = self;
    
    [self.view addSubview : tableview];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return data.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell=[[UITableViewCell alloc]initWithStyle:  UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.textLabel.text=data[indexPath.row];
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
